<?php
/**
 * common model file Created by PhpStorm.
 * User: wumengmeng
 * Date: 2019/10/16
 * Time: 17:34
 */

namespace HiCommon\Model;

class InvoiceApplyExtend extends Base
{
    
    protected $table = 'invoice_apply_extend';
    
    protected $guarded = [];
    
    //public $timestamps = false;
    
    /**
     * 应该被调整为日期的属性
     *
     * @var array
     */
    protected $dates = [
    ];
   

    //关联普通订单
    public function order(){
        return $this->hasOne(StoreOrder::class,'id','goods_order_id');
    }


    //关联服务订单
    public function order_repairstore(){
        return $this->hasOne(OrderRepairstore::class,'id','goods_order_id')->select('id','order_number','shop_id','goods_num','pay_price','is_invoice','created_at');
    }


    //关联订单
    public function order_checkpoint(){
        return $this->hasOne(OrderCheckpoint::class,'id','goods_order_id')->select('id','order_sn','shop_id','appointment_num','price','is_invoice','created_at');
    }

    //关联道路救援订单
    public function order_roadrescus(){
        return $this->hasOne(RoadRescueOrder::class,'id','goods_order_id')->select('id','order_sn','shop_id','price','is_invoice','created_at');
    }





}